<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@include file="/include/head.jsp"%>
<table id="dg" >
</table>

<div id="queryDialog" class="easyui-dialog" title="查询" style="width: 400px; height: 260px;"  
                 data-options="iconCls:'pag-list',modal:true,collapsible:false,minimizable:false,maximizable:false,resizable:false,closed:true,buttons:'#searchbb'">  
            <form action="" id="searchForm">
	            <table cellpadding="0" cellspacing="1" class="formtable">
								<tr>
				<td align="right"><label class="Validform_label">产品编码:</label></td>
				<td class="value">
					<input class="easyui-textbox" type="text"  id="code" name="code"/>
				</td>
				</tr>
				<tr>
				<td align="right"><label class="Validform_label">产品名称:</label></td>
				<td class="value">
					<input class="easyui-textbox" type="text"  id="name" name="name"/>
				</td>
				</tr>
				<tr>
				<td align="right"><label class="Validform_label">进价:</label></td>
				<td class="value">
					<input class="easyui-numberbox" type="text"  id="pprice" name="pprice"/>
				</td>
				</tr>
				<tr>
				<td align="right"><label class="Validform_label">规格:</label></td>
				<td class="value">
					<input class="easyui-textbox" type="text"  id="spec" name="spec"/>
				</td>
				</tr>
				<tr>
				<td align="right"><label class="Validform_label">售价:</label></td>
				<td class="value">
					<input class="easyui-numberbox" type="text"  id="sprice" name="sprice"/>
				</td>
				</tr>
				<tr>
				<td align="right"><label class="Validform_label">材质:</label></td>
				<td class="value">
					<input class="easyui-textbox" type="text"  id="stuff" name="stuff"/>
				</td>
				</tr>
				<tr>
				<td align="right"><label class="Validform_label">单位:</label></td>
				<td class="value">
					<input class="easyui-textbox" type="text"  id="unit" name="unit"/>
				</td>
				</tr>
				<tr>
				<td align="right"><label class="Validform_label">货品标题:</label></td>
				<td class="value">
					<input class="easyui-textbox" type="text"  id="pName" name="pName"/>
				</td>
				</tr>
				<tr>
				<td align="right"><label class="Validform_label">状态:</label></td>
				<td class="value">
					<input class="easyui-numberbox" type="text"  id="status" name="status" value="1"/>
				</td>
				</tr>
	            </table>  
            </form>
            <div style="text-align:right;margin-right:30px;"  id="searchbb">
                <a href="#" class="easyui-linkbutton" data-options="iconCls:'icon-search'" onclick="btnSearch()">查询</a>  
                <a href="#" class="easyui-linkbutton" data-options="iconCls:'icon-cancel'" onclick="btnSearchCancel()">取消</a>  
            </div>                  
</div>
<script type="text/javascript">
	$(function() {
		initCurdDatagrid('product','dg',{
			title:'产品',
			baseUrl:'',
			dwidth:'90%',//弹出对话框的宽度 百分比或者具体数字宽度
			dheight:'90%',//弹出对话框的高度 百分比或者具体数字宽度
			columns:[[    
				        {field:'code',title:'产品编码',width:80,sortable:true},    
				        {field:'name',title:'产品名称',width:100,sortable:true},    
				        {field:'pprice',title:'进价',width:60,sortable:true},    
				        {field:'sprice',title:'售价',width:60,sortable:true},    
				        {field:'unit',title:'单位',width:50,sortable:true},    
				        {field:'spec',title:'规格',width:120,sortable:true},    
				        {field:'stuff',title:'材质',width:120,sortable:true},    
				        {field:'pName',title:'货品标题',width:100,sortable:true},
				        {field:'vouchName',title:'开票标题',width:100,sortable:true},  
				        {field:'status',title:'状态',width:50,sortable:true,formatter:function(value,row,index){
							if (value == 0){
								return '禁用';
							} else {
								return '启用';
							}
						}}    
				    ]] 
		},[]);

	});
	function btnSearchCancel()
	{
		$("#queryDialog").dialog('close');  
	}
	function btnSearch()
	{ 
		var param = $("#searchForm").serializeObject();
		$('#dg').datagrid('load',param);
		$("#queryDialog").dialog('close');
	}
	
	function reloadData()
	{
		$('#dg').datagrid('reload');
	}
	
</script>

<%@include file="/include/foot.jsp"%>